package com.zzy.chapter4.decorator;

import com.zzy.chapter4.pojo.Order;
import com.zzy.chapter4.service.IOrderService;

public abstract class AbstractOrderServiceDecorator implements IOrderService {

    private IOrderService orderService;

    public void setOrderService(IOrderService orderService) {
        this.orderService = orderService;
    }

    @Override
    public Order createOrder(String productId) {
        return this.orderService.createOrder(productId);
    }

    @Override
    public Order payOrder(String orderId) {
        return this.orderService.payOrder(orderId);
    }

    @Override
    public Order send(String orderId) {
        return this.orderService.send(orderId);
    }

    @Override
    public Order receive(String orderId) {
        return this.orderService.receive(orderId);
    }

    @Override
    public String getPayUrl(String orderId, Float price, Integer payType) {
        return this.orderService.getPayUrl(orderId, price, payType);
    }

    protected abstract void updateScoreAndSendRedPaper(String productId, int serviceLevel, float price);
}
